<%-- 
    Document   : docheckout
    Created on : 11-May-2011, 19:10:14
    Author     : Arsonist
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<jsp:useBean id="user" class="checkout.CheckoutInfo" scope="session"/>
<jsp:setProperty name="user" property="*"/>

<%@ include file="header.jsp" %>
<% String validate = "";
        validate = user.validateInput(user.getCardType(), user.getCardNumber(),user.getCardHolder() ,
                                                user.getCardAddress(), user.getCardPostcode(), user.getExpiryMonth(),
                                                user.getExpiryYear(), user.getSecurityCode());
 %>
<!-- Content -->

<div id="container">
	<div id="content" role="main">
		<div id="post-0" class="post error404 not-found">
			<h1 class="entry-title">Checkout</h1>
			<div class="entry-content">
                            <% if(validate.equals("none")){ %>

                            <b>The payment details you have entered:</b><p></p>

                                <table>
                                    <tr><td>Card type: </td><td> <%= user.getCardType() %></td>
                                    <tr><td>Card number: </td><td> <%= user.getCardNumber()%></td></tr>
                                    <tr><td>Card holder's Name: </td><td> <%= user.getCardHolder()%></td></tr>
                                    <tr><td>Address: </td><td> <%= user.getCardAddress() %></td></tr>
                                    <tr><td>Postcode: </td><td> <%= user.getCardPostcode() %></td></tr>
                                    <tr><td>Expiry Date (MM/YY): </td><td> <%= user.getExpiryMonth()%>/<%=user.getExpiryYear()%> </td></tr>
                                    <tr><td>Security code: </td><td> <%= user.getSecurityCode() %></td></tr>
                                    <tr><td>Total Price: </td><td> <%= user.getPrice() %></td></tr>

                                    <tr><td><a HREF="finalcheckout.jsp"><input type="submit" value="Proceed"></a></td><td><a HREF="checkout.jsp"><input type="submit" value="Back"></a></td></tr>

                                </table>


                         <%} else{

                                response.sendRedirect("checkout.jsp?details");
                         
                           }%>

                        </div><!-- .entry-content -->
		</div><!-- #post-0 -->

	</div><!-- #content -->
</div><!-- #container -->



<!-- /Content -->

<%@ include file="footer.jsp" %>
